package me.spring.cloud.common.components.validator.annotation;

import me.spring.cloud.common.components.util.enums.DigitalTypeEnum;
import me.spring.cloud.common.components.validator.annotation.constraint.DigitalValidator;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import javax.validation.Constraint;
import javax.validation.Payload;


/**
 * @description: 数字类型
 * @author: luffy
 * @create: 2018-07-20 15:23
 **/
@Documented
@Constraint(validatedBy = DigitalValidator.class)
@Target({ElementType.METHOD, ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
public @interface DigitalType {

  String message() default "{Please provide us a valid value}";

  DigitalTypeEnum formatUnit() default DigitalTypeEnum.Real_number;

  Class<?>[] groups() default {};

  Class<? extends Payload>[] payload() default {};
}